<template>
	<view class="container">
		<view class="" style="display: flex;align-items: center;margin-top: 0px;">
			<view class="tag">现居住地：</view>
			<uni-easyinput v-model="user.address" placeholder="请输入现居住地" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">教育经历：</view>
			<uni-easyinput v-model="user.education" type="textarea" placeholder="请输入教育经历" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">工作经历：</view>
			<uni-easyinput v-model="user.experience" type="textarea" placeholder="请输入工作经历" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">个人简介：</view>
			<uni-easyinput v-model="user.individualResume" type="textarea" placeholder="请输入个人简介" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">期望薪资：</view>
			<uni-easyinput v-model="user.money" placeholder="请输入期望薪资" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">最高学历：</view>
			<uni-easyinput v-model="user.mostEducation" placeholder="请输入最高学历" />
		</view>
		<view class="" style="display: flex;align-items: center;margin-top: 20px;">
			<view class="tag">期望职位：</view>
			<uni-data-select v-model="user.positionId" :localdata="list" placeholder="请选择期望职位"></uni-data-select>
		</view>
		<button type="primary" @click="submit" style="margin-top: 20px;">添加</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {
					"mostEducation": "",
					"education": "",
					"address": "",
					"experience": "",
					"individualResume": "性格有点内向、乐观上进、有爱心并善于施教并行;对待工作认真负责，善于沟通、协调有较强的组织能力与团队精神;上进心强、勤于学习能不断进步自身的能力与综合素质。在未来的工作中，我将以充沛的精力，刻苦钻研的精神来努力工作，稳定地进步自己的工作能力，与公司同步发展。",
					"money": "",
					"positionId": null
				},
				list: []
			};
		},
		onLoad(item) {

		},
		onReady() {
			this.get('/prod-api/api/job/profession/list', {

			}, ).then(res => {
				let data = res.rows
				for (let s of data) {
					this.list.push({
						text: s.professionName,
						value: s.id
					})
				}
			})
		},
		onShow() {

		},
		methods: {
			submit() {
				this.isEmpty(this.user)
				this.post('/prod-api/api/job/resume', this.user).then(res => {
					uni.showToast({
						title: res.msg,
						icon: 'none'
					});
					if(res.code==200){
						setTimeout(function() {
							uni.navigateBack({
								delta: 1
							});
						}, 400);
					}
				})
			}
		}
	};
</script>

<style lang="scss">
	page {
		background-color: white;
	}
</style>
